﻿----------------------------------------------------------------------------------------------------
--
--  © 2012 Stanislav S. Yarmonov.
--
--  TODO:LICENSE
--     
----------------------------------------------------------------------------------------------------
EXECUTE [_DB].[Function_Drop]
	@@Name = '[_DB].[Procedure_Exists]'
GO

----------------------------------------------------------------------------------------------------
--
--  Check the existance of the stored procedure.
--
--  INPUT
--		@@Name
--		Name of the stored procedure to be checked.
--
----------------------------------------------------------------------------------------------------
CREATE FUNCTION [_DB].[Procedure_Exists] (
	@@Name [sysname]
)
RETURNS [bit]
AS
BEGIN
	RETURN CASE
		WHEN OBJECT_ID(@@Name, 'P') IS NOT NULL THEN 1
		ELSE 0
	END
END
GO
